package com.learn.service.impl;

import com.learn.dao.BooksMapper;
import com.learn.pojo.Books;
import com.learn.service.BooksService;

import java.util.List;

/**
 * Copyright: Copyright (c) 2020 Asiainfo
 *
 * @ClassName: com.learn.service.impl.BooksServiceImpl
 * @Description: 该类的功能描述
 * @version: v1.0.0
 * @author: lipan
 * @date: 2020/2/9 18:49
 * <p>
 * Modification History:
 * Date         Author          Version            Description
 * ------------------------------------------------------------
 * 2020/2/9      lipan          v1.0.0               修改原因
 */

public class BooksServiceImpl implements BooksService {


    private BooksMapper booksMapper;

    public void setBooksMapper(BooksMapper booksMapper) {
        this.booksMapper = booksMapper;
    }

    public int addBook(Books books) {
        return booksMapper.addBook(books);
    }

    public int deleteBook(int bookId) {
        int i= booksMapper.deleteBook(bookId);
        int j=1/0;
        return  i;
    }

    public int updateBook(Books books) {
        return  booksMapper.updateBook(books);
    }

    public Books getBookById(int bookId) {
        return booksMapper.getBookById(bookId) ;
    }

    public List<Books> findAll() {
        return  booksMapper.findAll();
    }
}
